﻿@model IEnumerable<FCNS.ERP.Models.ErpSeat>

@{
    ViewBag.Title = "枱号";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@ViewBag.Title</h2>

<p>
    <a class="newObjA" href="/Food/SeatNew">新增</a>
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.CategorySeatId)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.NumberOfPeople)
        </th>

        <th>
            @Html.DisplayNameFor(model => model.Status)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.CategorySeat.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.NumberOfPeople)
            </td>

            <td>
                @Html.DisplayFor(modelItem => item.Status)
            </td>
            <td>
                @if (item.Status == FCNS.ERP.Models.ErpSeat.EnumSeatStatus.空闲 || item.Status == FCNS.ERP.Models.ErpSeat.EnumSeatStatus.故障)
                {
                    @Html.ActionLink("编辑", "SeatEdit", new { id = item.Id }) @Html.Raw(" | ")
                    <a href="SeatDelete/@item.Id" class="objDelete">删除</a>
                }
            </td>
        </tr>
    }

</table>
